    <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?><!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/public/js/html5shiv.js"></script>
    <script type="text/javascript" src="/public/js/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/Hui-iconfont/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/laydate/skins/default/laydate.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="/public/js/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>快方管理后台</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <style type="text/css">
        .date{
            width: 100px;
        }
        .channel_list{
            text-align: center;
        }
        .channel_list .btn{
            padding-top: 15px;
            width: 150px;
            height: 50px;
            font-weight: bold;
            margin-right: 20px;
        }
    </style>
</head>
<body class="big-page">
<div class="Hui-article">
    <article class="cl pd-20">
        <div class="mt-10">
            <div class="channel_list"></div>
        </div>
    </article>
    <input type="hidden" name="store_id" value="<?=$_GET['store_id']?>">
</div>

<script type="text/javascript" src="/public/js/jquery.min.js"></script>
<script type="text/javascript" src="/public/plugins/layer/layer.js"></script>
<script type="text/javascript" src="/public/plugins/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/public/plugins/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/public/plugins/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript" src="/public/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/public/plugins/laydate/laydate.js"></script>
<script type="text/javascript">

    var color = [
        'btn-primary',
        'btn-secondary',
        'btn-success',
        'btn-warning',
        'btn-danger'
    ];
    $.ajax({
        url : window.location.href,
        type : "POST",
        dataType : "json",
        success : function(res){
            var html = "";
            var store_id = $("input[name='store_id']").val();

            for(k in res.data){
                var chn = res.data[k];
                var styleIndex = k % color.length;
                var style = color[styleIndex];
                var href = "/ChannelCategory/categoryList?store_id=" + store_id + "&chn_id=" + chn.id;
                html += "<a href='" + href + "' class='btn " + style + " radius'>" + chn.name + "</a>";
            }

            $(".channel_list").html(html);
        }
    })

</script>
</body>
</html>
